package com.zn.mapper;

import com.zn.entity.FutureOpenOrder;
import java.util.List;
import java.util.Map;

import com.zn.web.dto.FuturesTradeDto;
import com.zn.web.vo.DealRecordVo;
import com.zn.web.vo.OpenOrderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface FutureOpenOrderMapper {
    List<OpenOrderVo> selectOpenOrderByPage(Map<String,Object> map);
    int insertSelective(FutureOpenOrder record);
    FutureOpenOrder selectByPrimaryKey(String openId);
    List<FutureOpenOrder> selectListByOrderRef(@Param("orderRef")String orderRef);
    FutureOpenOrder selectByOrderRef(Map<String,Object> map);
    int updateByPrimaryKeySelective(FutureOpenOrder record);
    int updateEffectiveHoldVolume(FutureOpenOrder futureOpenOrder);
//    int updateHoldVolumeAndStatus(FutureOpenOrder futureOpenOrder);
    int updateCalculationData(Map<String,Object> map);
    int updateRiskManagementByOrderRef(FutureOpenOrder futureOpenOrder);
    /**查询当前持仓单**/
    List<FutureOpenOrder> selectPositionOrder(FutureOpenOrder futureOpenOrder);

    /**
     * 查询止盈止损订单
     * @param record  0、止损订单  1、止盈订单  2所有历史记录
     * @return
     */
    List<FutureOpenOrder> getTradersUseOrder(FuturesTradeDto record);

    /**分页查询成交记录**/
    List<DealRecordVo> getDealRecord(FuturesTradeDto record);

    //查询统计当天开仓交易数据
    List<FutureOpenOrder> findUserTradingOpen(FuturesTradeDto futuresTradeDto);
}